package com.jeespring.designpattern.abstractfactory;

/**
 * @Title: Factory
 * @Description:
 * @Author 张朝阳
 * @Date 2021/1/3 15:37
 */
public class Factory {
    public static AbstractFactory getFactory(String type){
        if(type.equals("水果")){
            return new FruitFactory();
        } else if(type.equals("蔬菜")){
            return new VegetableFactory();
        }
        return null;
    }
}
